from django.shortcuts import render
from django.http import HttpResponse,JsonResponse
from django.views import View
# Create your views here.
import uuid
from apps.index.models import LoginStatus
import time

class Index(View):
    def get(self,request):
        token = uuid.uuid4()
        print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime()))
        loginInfo = LoginStatus(token=token,create_time=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime()))
        loginInfo.save()
        return JsonResponse({'token':token})
class Other(View):
    def get(self,request):
        return HttpResponse('其他请求')